package com.typhoon.spring_jdbctemplate.compare;

import org.apache.commons.lang3.ArrayUtils;

/**
 * 对比规则
 * 
 * @author Typhoon
 * @date 2017-09-17 11:07 Sunday
 * @since V2.0
 */
public class CompareRule {
	/**
	 * 源数据属性
	 */
	private String[] sourceAttrs;

	/**
	 * 目标属性
	 */
	private String[] targetAttrs;

	/**
	 * 连接字符
	 */
	private String joinChar;

	/**
	 * 是否需要hash计算
	 */
	private boolean hash;

	/**
	 * 是否自行更新
	 */
	private boolean autoUpdate;

	public CompareRule() {
		this.joinChar = "_";
	}

	public String[] getSourceAttrs() {
		return this.sourceAttrs;
	}

	public void setSourceAttrs(String[] sourceAttrs) {
		this.sourceAttrs = ((String[]) ArrayUtils.clone(sourceAttrs));
	}

	public String[] getTargetAttrs() {
		return this.targetAttrs;
	}

	public void setTargetAttrs(String[] targetAttrs) {
		this.targetAttrs = ((String[]) ArrayUtils.clone(targetAttrs));
	}

	public String getJoinChar() {
		return this.joinChar;
	}

	public void setJoinChar(String joinChar) {
		this.joinChar = joinChar;
	}

	public boolean isHash() {
		return this.hash;
	}

	public void setHash(boolean hash) {
		this.hash = hash;
	}

	public boolean isAutoUpdate() {
		return this.autoUpdate;
	}

	public void setAutoUpdate(boolean autoUpdate) {
		this.autoUpdate = autoUpdate;
	}
}